<template>
  <div class="user_detail">
    <div class="user_info">
      <div class="left">
        <img :src="userModel.user_img" alt="" />
      </div>
      <div class="right">
        <div>
          <p>
            <span>0</span><span class="user_text">粉丝</span
            ><span class="line"></span>
          </p>
          <p>
            <span>0</span><span class="user_text">关注</span
            ><span class="line"></span>
          </p>
          <p><span>765</span><span class="user_text">获赞</span></p>
        </div>
        <div class="user_edit" @click="$router.push('/edit')">编辑资料</div>
      </div>
    </div>

    <div>
      <h2>{{ userModel.username }}</h2>
      <p v-if="userModel.user_desc">
        {{ userModel.user_desc }}<span>展开</span>
      </p>
      <p v-else>这个人很神秘，什么都没有写<span>展开</span></p>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    userModel: Object,
  },
};
</script>

<style lang="less" scoped>
.user_detail {
  background: white;
  width: 100%;
  box-sizing: border-box;
  padding: 2.778vw 1.944vw;
  margin-right: 5.556vw;
  .user_info {
    display: flex;
    .left {
      img {
        width: 23.611vw;
        height: 23.611vw;
        border-radius: 13.889vw;
      }
    }
  }
  .right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: 1.389vw;
    div {
      display: flex;
      justify-content: center;
      p {
        display: flex;
        align-items: center;
        flex: 1;
        flex-direction: column;
        font-size: 3.611vw;
        .user_text {
          color: #bdbdaa;
        }
        .line {
          width: 0.278vw;
          height: 3.611vw;
          background: #bdbdaa;
          position: absolute;
          transform: translate(11.111vw, 2.778vw);
        }
      }
    }
    .user_edit {
      border: 0.278vw solid #ffa7bc;
      width: 65.556vw;
      margin-left: 5.556vw;
      height: 9.722vw;
      border-radius: 1.111vw;
      color: #ffa7bc;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-top: 2.778vw;
    }
  }
  > div:nth-child(2) {
    h2 {
      font-size: 5vw;
      padding: 1.389vw 0vw;
    }
    p {
      font-size: 3.333vw;
      color: #999999;
      display: flex;
      justify-content: space-between;
      span {
        margin-right: 2.778vw;
      }
    }
  }
}
</style>